<extend name="Public/base"/>

<block name="body">

	 <link href="__MOBILE__/css/list.css" rel="stylesheet">
	 <link href="__MOBILE__/css/pointsmall.css" rel="stylesheet">
	 <div class="container">
		<div class="row">
			<div class="col-md-9">
				<ul class="nav nav-tabs">
				  <li role="presentation" class="<eq name="sort" value="create_time">active</eq>"><a href="{:U('PointsMall/index',array('type'=>$type))}">默认</a></li>
				  <li role="presentation" class="<eq name="sort" value="volume">active</eq>"><a href="{:U('PointsMall/index',array('sort'=>'volume','type'=>$type))}">销量</a></li>
				  <li role="presentation" class="<eq name="sort" value="price">active</eq>"><a href="{:U('PointsMall/index',array('sort'=>'price','type'=>$type))}">价格</a></li>
				  <li role="presentation" class="<eq name="sort" value="hits">active</eq>"><a href="{:U('PointsMall/index',array('sort'=>'hits','type'=>$type))}">浏览量</a></li>
				</ul>
			</div>
		</div>
	 	<div class="row">
	 		
	 			<div class="goods-list col-sm-12">
			        <ul class="list">
			        <volist name='goods' id='vo'>
			            <li class="list-unstyled">
			                <div class="item">
			                    <div class="goods-pic">
			                        <a target="_blank" class="pic-img" href="{:U('/pointsmall/'.$vo['id'])}">
			                            <img class="lazy img-responsive" src="{$vo.pic_url|get_image_url}" alt="{$vo.name}" style="display: inline;">
			                        </a>
			                    </div>
			                    <h5 class="title">
			                        <a class="black" target="_blank" href="{:U('/pointsmall/'.$vo['id'])}">{$vo.name}</a>
			                        <div style="display:none;" class="icon-all">
			                        </div>
			                    </h5>
			                     <div class="goods-price">
			                        <span class="price-current">
			                            <em>所需积分：</em>{$vo['price']|ceil}
			                        </span>
			                        
			                    </div>
			                   
			                </div>
			            </li>
			        	</volist>
			           
			        </ul>  
				</div>
	 	
	 	</div>
	 	
	 	<notempty name="_page">
    	 <div class="row">
	        	<div class="col-sm-12 ">
					<button id="next" class="btn" p="2" total-page="{$total_page}">
						点击加载更多
					</button>
				</div>
	      </div>
    </notempty>
      </div>	 
</block>
<block name="script">
<script>
	$(function(){

			
		 $('#next').click(function(){
		  	LoadPage();  
		  });
	});
	function LoadPage(){
		
		var currentPage = $('#next').attr('p') ? $('#next').attr('p') : 1;
		$.get("{:U('PointsMall/index')}",{'p':currentPage},function(result){
			if(result.errno==0){
				$('.goods-list .list').append(result.content);
				$('#next').attr('p',result.p);
				if(result.p>=$('#next').attr('total-page')){
					$('#next').html('木有了，亲');
					$('#next').attr('disabled',true);
					$('#next').addClass('disabled');
				}
			}
			
		},'json');	
	}
	</script>
</block>
